/*
 * Copyright 2023 NXP
 * NXP Proprietary. This software is owned or controlled by NXP and may only be used strictly in
 * accordance with the applicable license terms. By expressly accepting such terms or by downloading, installing,
 * activating and/or otherwise using the software, you are agreeing that you have read, and that you agree to
 * comply with and are bound by, such license terms.  If you do not agree to be bound by the applicable license
 * terms, then you may not retain, install, activate or otherwise use the software.
 */
/* 几个地方要改：
找到对应的链表，改变参数
lv_line_set_y_invert(line, true);// 反转y轴，LCD坐标系->平面直角坐标系第一象限
static static lv_point_t screen_1_chart_line_points_array_0[]

文本赋值
lv_label_set_text(guider_ui.screen_2_p2t0, "aaa");

lv_chart_set_update_mode(guider_ui.screen_2_chart_1, LV_CHART_UPDATE_MODE_SHIFT);

设置下一个点
lv_chart_set_next_value(guider_ui.screen_2_chart_1, chartSer1, y);

*/

/*********************
 *      INCLUDES
 *********************/
#include <stdio.h>
#include "lvgl.h"
#include "custom.h"
#include "math.h"
/*********************
 *      DEFINES
 *********************/

/**********************
 *      TYPEDEFS
 **********************/

/**********************
 *  STATIC PROTOTYPES
 **********************/

/**********************
 *  STATIC VARIABLES
 **********************/
uint8_t screen = 0;

void rt_kprintf(char *buffer);
void send_cmd(char *buffer);
/**
 * Create a demo application
 */

void custom_init(lv_ui *ui)
{
    /* Add your codes here */
}

void sine_draw_test(lv_ui *ui)
{
    for (int i = 0; i < 256; i++)
    {
        int data1 = (int)((sin(i * 3.14 / 80) + 1) * 128);
        int data2 = (int)((sin((i) * 3.14 / 80 + 1) + 1) * 128);
        lv_chart_set_next_value(ui->screen_1_chart_1, ui->screen_1_chart_1_0, data1);
        lv_chart_set_next_value(ui->screen_1_chart_1, ui->screen_1_chart_1_1, 255 - data2);
    }
}

void rt_kprintf(char *buffer)
{
}

void send_cmd(char *buffer)
{
}
